On the Subject of The Very Annoying Button

Good luck trying to get anything done.

This module consists of a hatch with a button behind it and a counter that resets approximately every ten seconds.

When the counter resets, there is a chance that the hatch will open, revealing a button in one of four colours.
The module does not give an audio indication when this occurs.

The button must be pressed before the module resets again.

When the button is pressed, the number of seconds remaining on the counter before the next reset is due is recorded.
When the counter resets, the recorded value is submitted and the hatch will close.

The validity of the submitted value depends on the colour of the button:

If the button is......, DO NOT press the button when the number of seconds remaining on the counter is...
redgreater than 5
yelloweven
greena multiple of 3 or 5
blueprime

In addition, the module keeps track of the most recent valid submission for each colour.
These values must also be avoided when the button is pressed.

Once the time remaining on the bomb drops below one minute or there are no other unsolved modules on the bomb, this module becomes solvable on its next reset.
In this state, the hatch will not close and strikes cannot be incurred from resets without submission.
A valid submission in this state will solve the module.